$(function(){
	//直接打印
	console.log(result);
    bindSubmit(result);

    function bindSubmit(data){
        var str=$("#subMit").html();
        //  var  sex=data[45];
        var res=ejs.render(str, {data: data});
        $(".report-data").html(res);
        //   alert(res);
    }
	//或者获取上一页路由传递的数据
	// var param = vipspa.parse();
	// console.log(param);
    var nowurl = 'http://120.132.101.30:8090' + '/result';
    $('.submit-btn').click(function () {
        result.end = getNowFormatDate();
        result.blog = $('.blog').val();

        console.log('提交前');
        console.log(result);

        // var nowresult = JSON.stringify(result);
        // alert(nowresult);
        $.ajax({
            headers: {
                Accept: 'application/json, text/plain, */*'
            },
            url : nowurl,
            type: "POST",
            data : JSON.stringify(result),//Requerst Payload
            dataType:'json',
            contentType:'application/json; charset=utf-8',


            success: function(data, textStatus, jqXHR){
                //console.log('ok');
              console.log('ok',data);
               localStorage.res=JSON.stringify(data) ;
                localStorage.sex=JSON.stringify(result);
                location.hash = vipspa.stringify('report');
            },
            error: function (jqXHR, textStatus, errorThrown){
                console.log('fail');
                console.log(errorThrown);
            }
        });

     //  location.hash = vipspa.stringify('home-2');
    })






});